package com.finalproject.entity;

import java.util.Calendar;
/**
 * Representation enttity class of ExpenseEntry
 * 
 *
 */
public class ExpenseEntry{
	private double amount;
	private double available;
	private Calendar date;
	public ExpenseEntry(Calendar date, double amount, double available){
		this.setDate(date);
		this.setAmount(amount);	
		this.setAvailable(available);
	}
	public boolean sameDate(ExpenseEntry compared){
		Calendar tempDay=compared.getDate();
		if ((date.get(Calendar.DAY_OF_MONTH)==tempDay.get(Calendar.DAY_OF_MONTH)) && (date.get(Calendar.MONTH)==tempDay.get(Calendar.MONTH)) && (date.get(Calendar.YEAR)==tempDay.get(Calendar.YEAR)))
			return true;
		return false;
	}
	public double getAmount() {
		return amount;
	}
	
	public double getAvailable() {
		return available;
	}
	
	public void setAvailable(double available) {
		this.available = available;
	}
	public void setAmount(double amount) {
		this.amount = amount;
	}
	public Calendar getDate() {
		return date;
	}
	public void setDate(Calendar date) {
		this.date = date;
	}
	public String toString(){
		return date.get(Calendar.YEAR)+"/"+date.get(Calendar.DAY_OF_MONTH)+"/"+date.get(Calendar.MONTH)+" - $"+amount;
	}
}